﻿namespace ProxyServer.Models
{
    public class PagedResult<T>(int totalCount, List<T> datas)
    {
        public PagedResult() : this(0, []) { }

        public int TotalCount { get; set; } = totalCount;
        public List<T> Datas { get; set; } = datas;
    }

    public class PageRequest(int index, int size)
    {
        public PageRequest() : this(1, 0)
        {

        }

        public int PageIndex { get; set; } = index;
        public int PageSize { get; set; } = size;

        public int Offset => ((PageIndex < 1 ? 1 : PageIndex) - 1) * PageSize;
    }
}
